<template>
    <div class="sell">
        <el-table :data="tableData" stripe style="width: 100%" height="500" border>
            <el-table-column prop="scriptWritingId" label="作品id" width="80" fixed/>
            <el-table-column prop="scriptWritingTitle" label="标题" width="150"></el-table-column>
            <el-table-column prop="createTime" label="创建时间" width="155"></el-table-column>
            <el-table-column prop="buyerID" label="买方ID" />
            <el-table-column prop="price" label="征稿金额" width="80">
                <template #default="scope">
                    <span>{{scope.row.price == null ? '免费' : '￥'+scope.row.price}}</span>
                </template>
            </el-table-column>
            <el-table-column label="我的操作" fixed="right" width="100">
                <template #default="scope">
                    <el-button type="primary" @click.stop="toDetail(scope.row)">查看</el-button>
<!--                    <el-button type="danger" @click.stop="del(scope.row)">删除</el-button>-->
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    import {SaleTradeInfo} from "../../api/TradeInfo";

    export default {
        name: "sell",
        data(){
            return{
                tableData:[]
            }
        },
        created(){
            this.getList()
        },
        methods:{
            getList(){
                SaleTradeInfo().then(res=>{

                    this.tableData=res.data.list
                    console.log('已卖出',this.tableData)

                })
            },
            toDetail(item){
                this.$router.push({path:'/dsp/dspDetail',query:{id:item.scriptWritingId}})
            }
        }
    }
</script>

<style scoped>

</style>
